<?php
/**
 * Created by PhpStorm.
 * User: a4041
 * Date: 2018/6/13
 * Time: 13:46
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ShopRoomTable extends Model
{
    use SoftDeletes;
    protected $table = 'shop_room_tables';
    protected $guarded = ['id'];
    protected $hidden = ['created_at','updated_at','deleted_at'];
    static function RoomTableFirst($id)
    {
        $data = ShopRoomTable::where('id',$id)->first();
        return $data;
    }

    public function shop()
    {
        return $this->belongsTo(Shop::class,'shop_id','id');
    }

    public function user()
    {
        return $this->belongsTo(User::class,'user_id','id');
    }
}